The return type and first parameter type for bdev_dax_supported() and
__bdev_dax_supported() were changed by commits
ba23cba9b3bd "fs: allow
per-device dax status checking for filesystems" and
80660f20252d "dax:
change bdev_dax_supported() to support boolean returns".
Avoid an ABI break by renaming the new version of
__bdev_dax_supported() and reintroducing the old version as a wrapper
for it. Add a #define so that the old version is hidden from the API,
i.e. newly built modules must use the new API.
Gbp-Pq: Topic debian
Gbp-Pq: Name dax-avoid-abi-change-in-4.17.6.patch
EXPORT_SYMBOL_GPL(fs_dax_get_by_bdev);
#endif
+#undef __bdev_dax_supported
+
/**
* __bdev_dax_supported() - Check if the device supports dax for filesystem
* @bdev: block device to check
*
* Return: true if supported, false if unsupported
*/
-bool __bdev_dax_supported(struct block_device *bdev, int blocksize)
+bool __bdev_dax_supported_new(struct block_device *bdev, int blocksize)
{
struct dax_device *dax_dev;
struct request_queue *q;
return true;
}
+EXPORT_SYMBOL_GPL(__bdev_dax_supported_new);
+
+int __bdev_dax_supported(struct super_block *sb, int blocksize)
+{
+ return __bdev_dax_supported_new(sb->s_bdev, blocksize)
+ ? 0 : -EOPNOTSUPP;
+}
EXPORT_SYMBOL_GPL(__bdev_dax_supported);
#endif
struct writeback_control;
int bdev_dax_pgoff(struct block_device *, sector_t, size_t, pgoff_t *pgoff);
#if IS_ENABLED(CONFIG_FS_DAX)
-bool __bdev_dax_supported(struct block_device *bdev, int blocksize);
+int __bdev_dax_supported(struct super_block *sb, int blocksize);
+bool __bdev_dax_supported_new(struct block_device *bdev, int blocksize);
+#define __bdev_dax_supported __bdev_dax_supported_new
static inline bool bdev_dax_supported(struct block_device *bdev, int blocksize)
{
return __bdev_dax_supported(bdev, blocksize);